package com.study.spmongodb.book.wwj.sp;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author MI
 * @version 1.0
 * @date 2020/12/3 22:16
 */
public class CreateStream {
    public static void main(String[] args) {

        createStreamFromValues().forEach(System.out::println);
    }

    private static Stream<String> createStreamFromCollection() {
        final List<String> asList = Arrays.asList("hello", "java", "scala");
        return asList.stream();
    }

    private static Stream<String> createStreamFromValues() {
        return Stream.of("hello", "java", "scala");
    }
}
